package jalus.model;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Blob;


/**
 * 文件存储
 * 
 *
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class File {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;
    @Persistent
    private String fileName;
    @Persistent
    private String mimeType;
    @Persistent(defaultFetchGroup="true")
    private Blob content;
    @Persistent
    private Date date;
	public File(String fileName, String mimeType, Blob content, Date date) {
		super();
		this.content = content;
		this.fileName = fileName;
		this.mimeType = mimeType;
		this.date = date;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getMimeType() {
		return mimeType;
	}
	public void setMimeType(String mineType) {
		this.mimeType = mineType;
	}
	public Blob getContent() {
		return content;
	}
	public void setContent(Blob content) {
		this.content = content;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Date getDate() {
		return date;
	}

}
